package week12;

import java.util.StringTokenizer;

public class Sorting {

    public Sorting(){

    }

    public String Sorting(String string) {
        String temp = null;

        String[] strs = string.split(" ");

        for (int i = 0; i < strs.length - 1; i++) {
            for (int j = i + 1; j < strs.length; j++){
                if (Integer.valueOf(strs[i]) > Integer.valueOf(strs[j])){
                    temp = strs[j];
                    strs[j] = strs[i];
                    strs[i] = temp;
                }
                else {}
            }
        }

        String result = "";
        for (int i = 0; i < strs.length; i++){
            result += strs[i] + " ";
        }

        return result;
    }

    public static void main(String[] args) {
        String string = "5 4 10 156 2 1 89";
        Sorting sorting = new Sorting();
        System.out.println(sorting.Sorting(string));

    }

}
